package cn.qu.netty.boot;

public class WebApplication {

	public static void run(Class<?> clazz, int port) {
		BootstrapApplication bootstrapApplication = clazz.getAnnotation(BootstrapApplication.class);
		if (bootstrapApplication == null) {
			throw new RuntimeException("miss Annotation ScannerPackage");
		}
		NettyServer nettyServer = NettyServer.createNettyServer();
		try {
			nettyServer.start(port, 128, bootstrapApplication.value());
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}
